package com.ruoyi.money.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.money.mapper.SysUserTransactionMapper;
import com.ruoyi.money.domain.SysUserTransaction;
import com.ruoyi.money.service.ISysUserTransactionService;

/**
 * 收支明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-18
 */
@Service
public class SysUserTransactionServiceImpl implements ISysUserTransactionService 
{
    @Autowired
    private SysUserTransactionMapper sysUserTransactionMapper;

    /**
     * 查询收支明细
     * 
     * @param transactionId 收支明细主键
     * @return 收支明细
     */
    @Override
    public SysUserTransaction selectSysUserTransactionByTransactionId(Long transactionId)
    {
        return sysUserTransactionMapper.selectSysUserTransactionByTransactionId(transactionId);
    }

    /**
     * 查询收支明细列表
     * 
     * @param sysUserTransaction 收支明细
     * @return 收支明细
     */
    @Override
    public List<SysUserTransaction> selectSysUserTransactionList(SysUserTransaction sysUserTransaction)
    {
        return sysUserTransactionMapper.selectSysUserTransactionList(sysUserTransaction);
    }

    /**
     * 新增收支明细
     * 
     * @param sysUserTransaction 收支明细
     * @return 结果
     */
    @Override
    public int insertSysUserTransaction(SysUserTransaction sysUserTransaction)
    {
        sysUserTransaction.setCreateTime(DateUtils.getNowDate());
        return sysUserTransactionMapper.insertSysUserTransaction(sysUserTransaction);
    }

    /**
     * 修改收支明细
     * 
     * @param sysUserTransaction 收支明细
     * @return 结果
     */
    @Override
    public int updateSysUserTransaction(SysUserTransaction sysUserTransaction)
    {
        sysUserTransaction.setUpdateTime(DateUtils.getNowDate());
        return sysUserTransactionMapper.updateSysUserTransaction(sysUserTransaction);
    }

    /**
     * 批量删除收支明细
     * 
     * @param transactionIds 需要删除的收支明细主键
     * @return 结果
     */
    @Override
    public int deleteSysUserTransactionByTransactionIds(Long[] transactionIds)
    {
        return sysUserTransactionMapper.deleteSysUserTransactionByTransactionIds(transactionIds);
    }

    /**
     * 删除收支明细信息
     * 
     * @param transactionId 收支明细主键
     * @return 结果
     */
    @Override
    public int deleteSysUserTransactionByTransactionId(Long transactionId)
    {
        return sysUserTransactionMapper.deleteSysUserTransactionByTransactionId(transactionId);
    }
}
